package ace.tool.generate.code.impl.service.model.input;

import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author caspar
 * @date 2024/1/11 9:19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GenerateIndexInput {
  /**
   * 索引名称,默认是表名 + columns
   * example: 唯一索引 uk_t_account_phonenumber or 普通索引 ix_t_account_phonenumber
   */
  @Builder.Default @Nullable private String name = null;

  /**
   * 唯一索引
   */
  @Builder.Default private Boolean uniqueFlag = false;

  /**
   * 索引列
   */
  @NotNull @NotEmpty private List<String> columns;
}
